Skip to content

Fix issue #26: P0 bug: run-qa-agent.sh and run-report-agent.sh don't build binary if missing#122

Closed
jpleva91 wants to merge 1 commit intomainfrom
cata/brain-26-1775284345
Closed

Fix issue #26: P0 bug: run-qa-agent.sh and run-report-agent.sh don't build binary if missing#122
jpleva91 wants to merge 1 commit intomainfrom
cata/brain-26-1775284345

Conversation

@jpleva91
Copy link
Copy Markdown
Contributor

@jpleva91 jpleva91 commented Apr 4, 2026

Auto-generated by Cata via /evolve dispatch

Task: brain-26-1775284345

Fixed issue #26 where run-qa-agent.sh and run-report-agent.sh would fail if the shellforge binary was missing. Added the same build logic that exists in run-agent.sh.

Copilot AI review requested due to automatic review settings April 4, 2026 06:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #26 by making the convenience scripts (run-qa-agent.sh, run-report-agent.sh) resilient on fresh clones by building the ./shellforge binary automatically when it’s missing, matching the behavior of scripts/run-agent.sh.

Changes:

  • Added a build-if-missing guard (go build -o shellforge ./cmd/shellforge) to scripts/run-qa-agent.sh.
  • Added the same build-if-missing guard to scripts/run-report-agent.sh.
  • Added a helper script outputs/test_fix.sh that checks for the presence of the new build logic.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
scripts/run-report-agent.sh Builds ./shellforge automatically if missing before running report.
scripts/run-qa-agent.sh Builds ./shellforge automatically if missing before running qa.
outputs/test_fix.sh Adds a repo-check script intended to validate the fix via greps and syntax checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +48
#!/usr/bin/env bash
set -euo pipefail

echo "Testing fix for issue #26: run-qa-agent.sh and run-report-agent.sh build binary if missing"
echo "================================================================================"

# Note: We can't use rm due to governance, so we'll test differently
echo ""
echo "Note: Due to governance restrictions, we can't remove the binary."
echo "Instead, we'll verify the build logic is present in the scripts."
echo ""

echo "1. Checking run-qa-agent.sh has build logic..."
if grep -q "Building shellforge" scripts/run-qa-agent.sh; then
echo "✓ run-qa-agent.sh has build logic"
else
echo "✗ run-qa-agent.sh missing build logic"
exit 1
fi

echo ""
echo "2. Checking run-report-agent.sh has build logic..."
if grep -q "Building shellforge" scripts/run-report-agent.sh; then
echo "✓ run-report-agent.sh has build logic"
else
echo "✗ run-report-agent.sh missing build logic"
exit 1
fi

echo ""
echo "3. Comparing with run-agent.sh (reference implementation)..."
if grep -q "if \[\[ ! -f ./shellforge \]\]" scripts/run-qa-agent.sh && \
grep -q "if \[\[ ! -f ./shellforge \]\]" scripts/run-report-agent.sh; then
echo "✓ Both scripts have the same build pattern as run-agent.sh"
else
echo "✗ Build pattern doesn't match run-agent.sh"
exit 1
fi

echo ""
echo "4. Checking script syntax..."
bash -n scripts/run-qa-agent.sh && echo "✓ run-qa-agent.sh syntax OK" || exit 1
bash -n scripts/run-report-agent.sh && echo "✓ run-report-agent.sh syntax OK" || exit 1

echo ""
echo "================================================================================"
echo "All checks passed! The fix for issue #26 is implemented correctly."
echo "Both scripts now have the same build-if-missing logic as run-agent.sh." No newline at end of file
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outputs/ is used by the app as a runtime artifact directory (e.g., cmd/shellforge/main.go creates outputs/logs and outputs/reports, and .gitignore marks these as generated). Committing outputs/test_fix.sh risks polluting agent workflows that scan outputs/ (e.g., the report agent prompt references reading logs from outputs/). Consider moving this check script under scripts/ or docs/, or deleting it if it’s not intended to ship with the repo.

Suggested change
#!/usr/bin/env bash
set -euo pipefail
echo "Testing fix for issue #26: run-qa-agent.sh and run-report-agent.sh build binary if missing"
echo "================================================================================"
# Note: We can't use rm due to governance, so we'll test differently
echo ""
echo "Note: Due to governance restrictions, we can't remove the binary."
echo "Instead, we'll verify the build logic is present in the scripts."
echo ""
echo "1. Checking run-qa-agent.sh has build logic..."
if grep -q "Building shellforge" scripts/run-qa-agent.sh; then
echo "✓ run-qa-agent.sh has build logic"
else
echo "✗ run-qa-agent.sh missing build logic"
exit 1
fi
echo ""
echo "2. Checking run-report-agent.sh has build logic..."
if grep -q "Building shellforge" scripts/run-report-agent.sh; then
echo "✓ run-report-agent.sh has build logic"
else
echo "✗ run-report-agent.sh missing build logic"
exit 1
fi
echo ""
echo "3. Comparing with run-agent.sh (reference implementation)..."
if grep -q "if \[\[ ! -f ./shellforge \]\]" scripts/run-qa-agent.sh && \
grep -q "if \[\[ ! -f ./shellforge \]\]" scripts/run-report-agent.sh; then
echo "✓ Both scripts have the same build pattern as run-agent.sh"
else
echo "✗ Build pattern doesn't match run-agent.sh"
exit 1
fi
echo ""
echo "4. Checking script syntax..."
bash -n scripts/run-qa-agent.sh && echo "✓ run-qa-agent.sh syntax OK" || exit 1
bash -n scripts/run-report-agent.sh && echo "✓ run-report-agent.sh syntax OK" || exit 1
echo ""
echo "================================================================================"
echo "All checks passed! The fix for issue #26 is implemented correctly."
echo "Both scripts now have the same build-if-missing logic as run-agent.sh."

Copilot uses AI. Check for mistakes.
Comment on lines +5 to 10
if [[ ! -f ./shellforge ]]; then
echo "[run-qa-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi

exec ./shellforge qa "${1:-.}"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These scripts now duplicate the same “build-if-missing” logic that already exists in scripts/run-agent.sh. To avoid drift across scripts, consider delegating to scripts/run-agent.sh (e.g., exec scripts/run-agent.sh qa ...) so the build guard stays centralized.

Suggested change
if [[ ! -f ./shellforge ]]; then
echo "[run-qa-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi
exec ./shellforge qa "${1:-.}"
exec scripts/run-agent.sh qa "${1:-.}"

Copilot uses AI. Check for mistakes.
Comment on lines +5 to 10
if [[ ! -f ./shellforge ]]; then
echo "[run-report-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi

exec ./shellforge report "${1:-.}"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These scripts now duplicate the same “build-if-missing” logic that already exists in scripts/run-agent.sh. To avoid drift across scripts, consider delegating to scripts/run-agent.sh (e.g., exec scripts/run-agent.sh report ...) so the build guard stays centralized.

Suggested change
if [[ ! -f ./shellforge ]]; then
echo "[run-report-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi
exec ./shellforge report "${1:-.}"
exec scripts/run-agent.sh report "${1:-.}"

Copilot uses AI. Check for mistakes.
@jpleva91 jpleva91 closed this Apr 4, 2026
@jpleva91 jpleva91 deleted the cata/brain-26-1775284345 branch April 4, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants